import request from '@/utils/Request'

// 机构列表-树形
export const listOrgTree = bId => {
    if (bId === undefined || bId === null) {
        bId = 0
    }
    return request({
        method: 'get',
        url: '/api/platform/org/list/tree/' + bId,
        params: {}
    })
}

// 机构列表
export const listOrg = data => {
    return request({
        method: 'get',
        url: '/api/platform/org/list',
        params: data
    })
}

// 新建机构
export const createOrg = data => {
    return request({
        method: 'post',
        url: '/api/platform/org/create',
        data: data
    })
}

// 更新机构
export const updateOrg = data => {
    return request({
        method: 'post',
        url: '/api/platform/org/update',
        data: data
    })
}

// 保存机构
export const saveOrg = data => {
    return request({
        method: 'post',
        url: '/api/platform/org/save',
        data: data
    })
}

export const deleteOrg = bId => {
    return request({
        method: 'get',
        url: '/api/platform/org/delete/' + bId,
        params: {}
    })
}
